const {
  baseUrl,
  getRequest,
  postRequest
} = require("../../../utils/request.js")
Page({
  /**
   * 页面的初始数据
   */
  data: {
    //注册信息
    username: '',
    password: '',
    passwordRe: '',
    phone: '',
    code: ''
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad(options) {

  },
  /**
   * 注册
   */
  submitRegister() {
    postRequest(baseUrl + "/front/user/register", {
      userImg: "https://lf-flow-web-cdn.doubao.com/obj/flow-doubao/doubao/web/static/image/logo-icon-white-bg.f3acc228.png",
      nickname: '昵称4674987987',
      username: this.data.username,
      password: this.data.password,
      phone: this.data.phone,
    }).then(res => {
      if (res.code == 200) {
        wx.navigateTo({
          url: '/pages/home/login/login',
        })
      }
    })
  },
  /**
   * 跳转登录页面
   */
  onLoginPage() {
    wx.navigateTo({
      url: '/pages/home/login/login',
    })
  }
})